<template>
    <div class="container">
        <img class="card" :src="card" alt="">
        <div class="card-info">
            <div class="card-body">
                <router-link to="/home" class="title">{{title}}</router-link>
                <div class="introduction">{{introduction}}</div>
            </div>
            <div class="time">
                {{date}}
            </div>
        </div>

    </div>
</template>

<script>
import { useDate } from '../../hooks/useDate';

export default {
    props: {
        card: String,
        title: String,
        introduction: String
    },
    setup() {
        return {
            ...useDate()
        }

    }
}
</script>

<style lang="less" scoped>
.container {
    width: 100%;
    height: 100%;
    position: relative;
    color: hsla(0, 0%, 100%, .85);
    font-size: 27px;
    overflow: hidden;
    text-shadow: inset 0 1px 1px #fff, inset -1px 0px 1px #fff;
}

.card-info {
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    position: absolute;
    left: 0;
    top: 0;
    transition: all .5s;
}

.card-info:hover {
    background-color: rgba(0, 0, 0, .1);
}

.card-info:hover .time {
    transform: translateX(0)
}

.card-body {
    position: absolute;
    bottom: 30px;
    padding: 0 3vw;
    transform: translateY(100% + 30px);
    transition: all .5s;
}

.time {
    position: absolute;
    right: 3vw;
    top: 3vw;
    transform: translateX(100% + 30vw);
    transition: all .5s;
}

.card {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info:hover .card-body {
    transform: translateY(0);
}

.title {
    font-size: 50px;
    text-align: center;
    margin-bottom: 5vh;
    display: block;
    color: inherit;
    text-shadow: 0 1px 3px var(--el-color-primary), 0 3px 10px var(--el-color-primary), 0 20px 30px var(--el-color-primary);
}

.introduction {
    text-indent: 2em;
    color: #fff;
    text-shadow: inset 0 -1px 1px rgba(0, 0, 0, .3);
}
</style>